]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
runDialog: Factor out calculation of whether to enable internal commands
authorPhilip Withnall <pwithnall@gnome.org>
Thu, 20 Nov 2025 16:31:46 +0000 (16:31 +0000)
committerPhilip Withnall <pwithnall@gnome.org>
Thu, 20 Nov 2025 17:25:23 +0000 (17:25 +0000)
This doesn’t result in any behaviour change at the moment, but will
simplify an upcoming commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3968>

js/ui/runDialog.js

index 2d6c717047bcb0ad5a274c57e04523d1033d6da4..89ae38190457262341c9554e64fba106fd2cca43 100644 (file)
@@ -32,9 +32,9 @@ class RunDialog extends ModalDialog.ModalDialog {
         this._lockdownSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
         this._terminalSettings = new Gio.Settings({schema_id: TERMINAL_SCHEMA});
         global.settings.connect('changed::development-tools', () => {
-            this._enableInternalCommands = global.settings.get_boolean('development-tools');
+            this._updateEnableInternalCommands();
         });
-        this._enableInternalCommands = global.settings.get_boolean('development-tools');
+        this._updateEnableInternalCommands();
 
         this._internalCommands = {
             'lg': () => Main.createLookingGlass().open(),
@@ -118,6 +118,10 @@ class RunDialog extends ModalDialog.ModalDialog {
         });
     }
 
+    _updateEnableInternalCommands() {
+        this._enableInternalCommands = global.settings.get_boolean('development-tools');
+    }
+
     vfunc_key_press_event(event) {
         this._pressedKey = event.get_key_symbol();
     }